:This built-in help system is extremely limited.
Please try reading the Chipmunk Basic man page and README
file or the WWW page
Try entering any keywords marked by angle brackets
into the help dialog box (Type in without the angle brackets.) -
!:
Type a keyword into the dialog box without any angle brackets.
!:
+ - * / ^ mod and or xor not > < >= <= <> =
see also -
!:
true false pi
!:
load save run new clear exit cont renum
(Program names must end with a ".bas" to appear in the Open dialog box.)
see also -
!:
let if then else endif gosub return goto rem
for to step next while wend exit while select case
data read restore dim erase sub end sub degrees radians
see also -
!:
gosub line_num
return
sub mumble(param1, param2) ' Define sub with 2 params.
mumble = 7 + param1 ' set return value
end sub
x = mumble(1) ' Calls sub. Extra params are set to 0.
!:
sqr log exp sin cos tan atn
abs sgn int rnd peek
asin acos sinh cosh tanh log10 floor ubound isarray
mid$ right$ left$ str$ chr$ val len asc
lcase$ ucase$ field$ inkey$ input$ format$
see also -
!:
field$(my_str$, word_num) ' Chops words out of a sentence.
field$(s$, n, seperator_char$) ' Space is seperator default.
!:
moveto x,y ' This sets the starting point.
lineto x,y ' Draw a line to this end point.
pset x,y ' Draw one dot.
graphics circle r
graphics rect x1,y1, x2,y2 ' Draws a rectangle.
graphics fillrect x1,y1, x2,y2 ' also filloval for ovals
see also -
!:
graphics color r,g,b ' red, green, blue values (range 0-100)
graphics color 100,100,100 ' white
graphics color 100, 0, 0 ' red
!:
graphics 0 ' This makes the window appear.
' Also refreshes graphics.
graphics window w,h ' Changes the size.
graphics window x,y, w,h ' Moves it.
graphics -1 ' Hides the graphics window.
graphics drawtext s$ ' Draws text.
see also -
!:
botton_down = mouse(0)
current_x = mouse(1) : current_y = mouse(2)
last_click_x = mouse(3)
!:
sprite 1, 100,50, 128 ' Draws sprite #1 at (100,50)
sprite n, x,y, rsrc_id ' Sprites are ICN# icon images.
' built in sprite rsrc_id's are 128 to 142
sprite n forward x ' Moves sprite #n x pixels.
sprite n turn d ' Turns heading CCW d degrees.
turnleft turnright up down penup pendown
' Create your own sprites with ResEdit.
!:
graphics pict x, y, filename$ ' Displays a PICT file.
call "savepicture", fname$ ' Saves a PICT file.
!:
sound 800, 0.5, 50 ' Play a sound for half a sec.
sound freq,dur,vol ' Hz, seconds, vol [0 to 100]
sound 0, rsrc_id ' Plays a snd resource.
sound -2,voice,key,velocity,seconds [,channel]
' sound -2 requires Quicktime 2.1 Midi
see also -
!:
morse "cq de n6ywu"
morse my_string$,20,40,13,700 ' dots,vol,wpm,Hz
!:
say "hello" : ' requires Speech Manager extension
say my_string$, 196, 44, 1 : ' rate, pitch, voice
say : ' reads out the console window
cls : ' clears the console window
print macfunction("numSpeakers")
print macfunction("getSpeaker") :' current voices name
!:
OOP - Object Oriented Programming - Just some syntax hints here -
class my_class [ extends super_class_name ]
[public|private] x as [integer|double|string]
... ' Etc.
sub member_function_name() ' Define public member function.
this.x = ...
member_function_name = return_value
end sub
end class ' End class definition
dim a as new my_class ' Create an instance.
a.member_function_name() ' Call member function.
!:
open filename$ for input as #1
open "SFGetFile" for input as #3
while not eof(3) : input #3,a$ : print a$ : wend : close #3
open "SFPutFile" for output as #4
a$ = inkey$ ' Polls for keyboard input. Non-blocking.
see also -
!:
input s$ ' Prompts for an input string.
' Puts the entire input line in s$.
input x ' Input one line. Convert to a number.
input my_prompt$, y ' Set your own prompt.
input #3, s$ ' Input from a file (must be open first.)
x = fgetbyte #3 ' Gets one byte from a file.
!:
print "hello"
print "hello"; ' Prints without a carriage return or line feed.
print 1+2
print #4,s$ ' Prints to a file (must be open first.)
print format$(x, "$###.##") ' Prints a formatted number.
gotoxy x,y ' Position cursor in console window. (0 origin)
!:
files ' Lists the current directory.
files path$, any$ ' Sets the current dir.
errorstatus$ ' Will return the path afterwards.
!:
open "COM1:" for input as #3 ' Requires CTB Serial Tool.
open "COM1:" for output as #4 ' Open input first.
if not eof(3) then i = fgetbyte(3)
open "COM3: 19200" for input as #5 ' Uses the old serial driver.
!:
a$ = inputbox("prompt", "title", "default", 0)
' Puts up a dialog box and ask for input.
graphics button title$, x,y,w,h,asc("t")
' Puts up a button that enters the letter "t".
graphics button "",-1 ' Clears all buttons.
see also -
!!:
other Mac specific functions -
date$ time$ timer doevents
call "wait", 1 ' Waits one second.
fre ' free memory in application heap
cls ' Clears the screen.
see also -
!:
These are just hints. -
call "doscript","MOSS", url$, "GURL", "GURL"
'sends a get URL AppleEvent to Netscape(tm)
call "setfiletype", "TEXT"
x = macfunction("keydown", key_code) ' Is this key down?
!:
rhn 96Jul18 v004
!!
to do list:
append random get put input$
fseek# fputbyte
home htab vtab pos
varptr peek poke type single static
msgbox do loop until menu dialog
--